<!DOCTYPE html>
<html>
<head>
<title>Phase Diagram</title>
</head>
<body>
<canvas id="physicsCanvas" width="450" height="360"></canvas>
<script>
    const canvas = document.getElementById('physicsCanvas');
    const ctx = canvas.getContext('2d');

    // Style settings based on the image
    ctx.lineWidth = 2;
    ctx.strokeStyle = 'black';
    ctx.fillStyle = 'black';
    
    // Define coordinate system parameters
    const originX = 60;
    const originY = 300;
    const axisLenX = 300;
    const axisLenY = 240;
    const H0_y = originY - axisLenY;
    const Tc_x = originX + axisLenX;
    
    // --- Draw Axes ---
    ctx.beginPath();
    // Y-axis (H)
    ctx.moveTo(originX, originY);
    ctx.lineTo(originX, H0_y - 30);
    // Arrowhead for Y-axis
    ctx.moveTo(originX, H0_y - 30);
    ctx.lineTo(originX - 6, H0_y - 20);
    ctx.moveTo(originX, H0_y - 30);
    ctx.lineTo(originX + 6, H0_y - 20);
    
    // X-axis (T)
    ctx.moveTo(originX, originY);
    ctx.lineTo(Tc_x + 30, originY);
    // Arrowhead for X-axis
    ctx.moveTo(Tc_x + 30, originY);
    ctx.lineTo(Tc_x + 20, originY - 6);
    ctx.moveTo(Tc_x + 30, originY);
    ctx.lineTo(Tc_x + 20, originY + 6);
    ctx.stroke();

    // --- Draw Labels and Ticks ---
    ctx.font = 'bold 22px serif';
    ctx.textAlign = 'center';
    ctx.textBaseline = 'middle';

    // Axis labels
    ctx.fillText('H', originX, H0_y - 45);
    ctx.fillText('T', Tc_x + 45, originY);

    // Tick labels
    ctx.font = '22px serif';
    ctx.textAlign = 'right';
    ctx.fillText('H\u2080', originX - 10, H0_y);
    ctx.textAlign = 'center';
    ctx.fillText('T\u209C', Tc_x, originY + 20);
    
    // --- Draw the Phase Boundary Curve ---
    // Hc(T) = H0 * [1 - (T/Tc)^2]
    ctx.beginPath();
    ctx.moveTo(originX, H0_y); // Start at (T=0, H=H0)
    
    const steps = 100;
    for (let i = 1; i <= steps; i++) {
        const t_norm = i / steps; // Normalized temperature T/Tc
        const h_norm = 1 - t_norm * t_norm; // Normalized field H/H0
        
        const x = originX + t_norm * axisLenX;
        const y = originY - h_norm * axisLenY;
        
        ctx.lineTo(x, y);
    }
    ctx.stroke();

    // --- Draw Phase Information ---
    ctx.font = '24px serif';
    ctx.textAlign = 'center';

    // S phase region
    ctx.fillText('S phase', originX + 100, originY - 140);
    ctx.fillText('B = 0', originX + 100, originY - 105);

    // N phase region
    ctx.fillText('N phase', originX + 210, originY - 190);
    ctx.fillText('B \u2260 0', originX + 210, originY - 155);

    // --- Draw Figure Caption ---
    ctx.font = '20px serif';
    ctx.fillText('Fig. 1.41.', (originX + Tc_x) / 2, originY + 45);

</script>
</body>
</html>